﻿using System;
using Team4Mock.DAO;
using System.Data;
namespace Team4Mock.Entity
{
    public class DirectorateEntity
    {
        DirectorateDAO d=new DirectorateDAO();
        private int directorateid;
        private string directorateName;
        private string directorateShortDescription;
        private int contactID;
        private string addressLine1;
        private string addressLine2;
        private string addressLine3;
        private string postcode;
        private string town;
        private string county;
        private string country;
        private string typeOfBusiness;
        private string sICCode;
        private string directorateFullDescription;
        private string phoneNumber;
        private string fax;
        private string webAddress;
        private string charityNumber;
        private string companyNumber;
        private int organizationID;
        private int isactive;
        public DirectorateEntity()
        { }
        public DirectorateEntity(string directorateName, string directorateShortDescription, int contactID, string addressLine1, string addressLine2, string addressLine3, string postcode, string town, string county, string country, string typeOfBusiness, string sICCode, string directorateFullDescription, string phoneNumber, string fax, string webAddress, string charityNumber, string companyNumber, int organizationID)
        {
            this.directorateName = directorateName;
            this.directorateShortDescription = directorateShortDescription;
            this.contactID = contactID;
            this.addressLine1 = addressLine1;
            this.addressLine2 = addressLine2;
            this.addressLine3 = addressLine3;
            this.postcode = postcode;
            this.town = town;
            this.county = county;
            this.country = country;
            this.typeOfBusiness = typeOfBusiness;
            this.sICCode = sICCode;
            this.directorateFullDescription = directorateFullDescription;
            this.phoneNumber = phoneNumber;
            this.fax = fax;
            this.webAddress = webAddress;
            this.charityNumber = charityNumber;
            this.companyNumber = companyNumber;
            this.organizationID = organizationID;
        }

        public string DirectorateName
        {
            get { return this.directorateName; }
            set { this.directorateName = value; }
        }
        public string DirectorateShortDescription
        {
            get { return this.directorateShortDescription; }
            set { this.directorateShortDescription = value; }
        }
        public int ContactID
        {
            get { return this.contactID; }
            set { this.contactID = value; }
        }

        public int Directorateid
        {
            get { return directorateid; }
            set { directorateid = value; }
        }


        public int IsActive
        {
            get { return this.isactive; }
            set { this.isactive = value; }
        }
        public string AddressLine1
        {
            get { return this.addressLine1; }
            set
            {
                if (value == null)
                    throw new Exception("addressLine1 not allow nullvalue.");
                this.addressLine1 = value;
            }
        }
        public string AddressLine2
        {
            get { return this.addressLine2; }
            set { this.addressLine2 = value; }
        }
        public string AddressLine3
        {
            get { return this.addressLine3; }
            set { this.addressLine3 = value; }
        }
        public string Postcode
        {
            get { return this.postcode; }
            set { this.postcode = value; }
        }
        public string Town
        {
            get { return this.town; }
            set { this.town = value; }
        }
        public string County
        {
            get { return this.county; }
            set { this.county = value; }
        }
        public string Country
        {
            get { return this.country; }
            set { this.country = value; }
        }
        public string TypeOfBusiness
        {
            get { return this.typeOfBusiness; }
            set
            {
                if (value == null)
                    throw new Exception("typeOfBusiness not allow nullvalue.");
                this.typeOfBusiness = value;
            }
        }
        public string SICCode
        {
            get { return this.sICCode; }
            set { this.sICCode = value; }
        }
        public string DirectorateFullDescription
        {
            get { return this.directorateFullDescription; }
            set { this.directorateFullDescription = value; }
        }
        public string PhoneNumber
        {
            get { return this.phoneNumber; }
            set { this.phoneNumber = value; }
        }
        public string Fax
        {
            get { return this.fax; }
            set { this.fax = value; }
        }
        public string WebAddress
        {
            get { return this.webAddress; }
            set { this.webAddress = value; }
        }
        public string CharityNumber
        {
            get { return this.charityNumber; }
            set { this.charityNumber = value; }
        }
        public string CompanyNumber
        {
            get { return this.companyNumber; }
            set { this.companyNumber = value; }
        }
        public int OrganizationID
        {
            get { return this.organizationID; }
            set { this.organizationID = value; }
        }
        public DataTable GetDataByID(DirectorateEntity e)
        {
            return d.GetDataById(e.OrganizationID);
        }
        public void Insert(DirectorateEntity a)
        {
            d.Insert(a.DirectorateName,a.DirectorateShortDescription,a.ContactID,a.AddressLine1,a.AddressLine2,a.AddressLine3,a.Postcode,a.Town,a.County,a.Country,a.TypeOfBusiness,a.SICCode,a.DirectorateFullDescription,a.PhoneNumber,a.Fax,a.WebAddress,a.CharityNumber,a.CompanyNumber,a.OrganizationID,a.IsActive);
        }
        public void Update(DirectorateEntity a)
        {
            d.Update(a.DirectorateName, a.DirectorateShortDescription, a.ContactID, a.AddressLine1, a.AddressLine2, a.AddressLine3, a.Postcode, a.Town, a.County, a.Country, a.TypeOfBusiness, a.SICCode, a.DirectorateFullDescription, a.PhoneNumber, a.Fax, a.WebAddress, a.CharityNumber, a.CompanyNumber, a.OrganizationID, a.IsActive,a.Directorateid);
        }
        public DataTable CopyOrganization(DirectorateEntity a)
        {
            return d.CopyOrg(a.OrganizationID);
        }
        public DataTable GetIDDirec(DirectorateEntity a)
        {
            return d.Directorate_GetID(a.Directorateid);
        }
        public void Del(DirectorateEntity e)
        {
            d.Del(e.Directorateid);
        }
    }
}